<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
    <script src="../js/jquery.min.js"></script>
</head>
<body>
    <script>

        console.log("=========223扩展运算符========")
        function add(x,y){
            return x + y;
        }
        const numbers = [4,32];
        let result = add(...numbers);
        console.log(...numbers);//将一个数组转为用逗号分隔的参数序列，主要用于函数调用
        console.log(result);//42

        console.log("=========2.24使用Array.from方法=============")
        let arrayLike={
            '0':'a',
            '1':'b',
            '2':'c',
            length:3
        };
        //es5的写法
        var arr1 = [].slice.call(arrayLike);//['a','b','c']
        //es6的写法
        var arr2 = Array.from(arrayLike);//['a','b','c']

        console.log("=======2.25转化NodeList集合========");
        let ps = document.querySelectorAll('p');
        let ps2 = Array.from(ps);
        console.log(ps2);


        </script>
    
</body>
</html>